/************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
  * @file     dma.h
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-01
  * @brief    
 *************************************************************************/

#ifndef _DMA_H
#define _DMA_H

#include "data.h"
#include "lt168.h"

//#define  DMA_8TO8    0
//#define  DMA_16TO8   15
//#define  DMA_32TO8   31

#define  QSPI_STD     0
#define  QSPI_DUAL    1
#define  QSPI_QUAD    2

#define  QSPI_8BIT    7
#define  QSPI_16BIT   15
#define  QSPI_32BIT   31

#define  QSPI_TXRX   0
#define  QSPI_TX     1
#define  QSPI_RX     2

void QSPI_First_Init(qspi* t, uint8_t Frame_Format, uint8_t cmd_bits, uint8_t addr_bits, uint8_t dum_bits, uint8_t DFS,
		uint32_t numbyte, uint8_t TMOD);

void DMA_Channel_Init_32to8(dma_tcd *test_ch, uint32_t dst, uint32_t src, uint32_t numbyte, uint8_t inc);
void DMA_Channel_Init_16to8(dma_tcd *test_ch, uint32_t dst, uint32_t src, uint32_t numbyte, uint8_t inc);

extern void lt_screen_frame_update(void);

// eFLASH dma
//#define  eFlash   QSPI0     // for mcu code

// external FLASH dma
#define  exFlash   QSPI1
#define  exFlash_rxch   DMA_QSPI1_RX_Channel   // dma rx channel
#define  exFlash_txch   DMA_QSPI1_TX_Channel   // dma tx channel

// uart communication dma
#define  COMuart   SCI1

#endif /* _DMA_H */
